from pydantic import BaseModel, Field
from app.api.admin.schemas.base import RecodeMixinSchema


class UserOutSchema(BaseModel, RecodeMixinSchema):
    username: str = Field(description="用户名")
    age: int = Field(description="年龄")
    class Config:
        pass
        from_attributes=True # 读取python对象的属性，databases orm模型


class UserInSchema(BaseModel):
    username: str = Field(description="用户名")
    age: int = Field(description="年龄")

class UserSearchSchema(BaseModel):
    user_id: int | None = Field(default=None, description="用户id")
    username: str | None = Field(default=None, description="用户名")
    age: int | None = Field(default=None, description="年龄")
    created_time: str | None = Field(default=None, description="创建时间")
    created_by: str | None = Field(default=None, description="创建者")
